Python 3.8.13 (default, Dec  5 2023, 17:08:48) 
[GCC 11.4.0 20230528 (ROSA)] on linux
Type "help", "copyright", "credits" or "license()" for more information.
>>>  u = input()
mx = 0
a = [u[0], u[1], u[2], u[3], u[0:2], u[1:3], u[2:4], u[0:3], u[1:4], u]
for j in range(len(a)):
    n = int(a[j])
    c = 0
    for i in range(1, n+1):
        if n%i == 0:
            c = c + 1
    if c == 2:
        mx = max(mx, n)
print(mx)
